<template>
	<view class="loading">
		<view class="bg-white flex-sub radius shadow-lg" >
                  
			<image :src="imgUrl[isStatus]" mode="aspectFit" class="gif-white response" style="height:240upx" v-if="isStatus=='load'"></image>
	      
			<view class="middle" v-if="isStatus=='disconnection'">
	        	<view>网络异常~</view>
				<view class="text-blue" @tap="replayLoad">重新加载</view>
	        </view>
			
	
	
		</view>
	</view>
</template>

<script>
	export default {
		name: "Loading",
		props:{
			isStatus:{
				type: String,
				default: 'load'
			},
			isLoading:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {
				imgUrl:{
					load:this.resDomain+'/static/img/loading-white.gif',
					error1:this.resDomain+'/static/img/error1.png',
					error2:this.resDomain+'/static/img/error2.png',
					
				}

			}

		},
		watch:{
			isLoading(val){
				if(val){
					setTimeout(()=>{
						
					},1000)
				}
			}
		},
	
		methods:{
			replayLoad(){
				uni.showLoading({
					title:"加载中...",
					
				})
				this.$parent.loadData();
				
			}
		}
		

	}
</script>

<style scoped>
	.loading{
		width: 100%;
		height: 100%;
		z-index: 10;
		display: flex;
		align-items: center;
		justify-content: center;
		
	}
	
	
</style>
